package com.huan.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class ViewController {
    @RequestMapping("/testThymeleafView")
    public String testThymeleafView(){
        return "success";
    }

    @RequestMapping("/testForward")
    //转发视图InternalResourceView
    public String testForward(){
        //创建两次视图
        //第一次：解析forward:/testThymeleafView -》 转发视图
        //第二次：解析success -》 ThymeleafView
        return "forward:/testThymeleafView";
    }

    @RequestMapping("/testRedirect")
    public String testRedirect(){
        return "redirect:/testThymeleafView";
    }
}
